﻿<phone:PhoneApplicationPage xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
           xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
           xmlns:c="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           xmlns:tk="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
           xmlns:ctrls="clr-namespace:GooNews.Controls"
           xmlns:System="clr-namespace:System;assembly=mscorlib"
           x:Class="GooNews.MainPage"
           mc:Ignorable="d"
           d:DesignWidth="656"
           d:DesignHeight="480"
           SupportedOrientations="PortraitOrLandscape"
           Orientation="Portrait"
           shell:SystemTray.IsVisible="True">
  <phone:PhoneApplicationPage.Resources>
    <DataTemplate x:Key="pageTemplate">
      <ctrls:NewsPageControl />
    </DataTemplate>
  </phone:PhoneApplicationPage.Resources>

  <phone:PhoneApplicationPage.FontFamily>
    <StaticResource ResourceKey="PhoneFontFamilyNormal" />
  </phone:PhoneApplicationPage.FontFamily>
  <phone:PhoneApplicationPage.FontSize>
    <StaticResource ResourceKey="PhoneFontSizeNormal" />
  </phone:PhoneApplicationPage.FontSize>
  <phone:PhoneApplicationPage.Foreground>
    <StaticResource ResourceKey="foreBrush" />
  </phone:PhoneApplicationPage.Foreground>

  <phone:PhoneApplicationPage.ApplicationBar>
    <shell:ApplicationBar BackgroundColor="{StaticResource appBarColor}"
                          ForegroundColor="{StaticResource appBarForeColor}"
                          IsVisible="False">
      <shell:ApplicationBar.MenuItems>
        <shell:ApplicationBarMenuItem x:Name="settingsMenuItem"
                                      Text="settings"
                                      Click="settingsMenuItem_Click" />
        <shell:ApplicationBarMenuItem x:Name="rateMenuItem"
                                      Text="rate and review"
                                      Click="rateMenuItem_Click" />
        <shell:ApplicationBarMenuItem x:Name="aboutMenuItem"
                                      Text="about"
                                      Click="aboutMenuItem_Click" />
      </shell:ApplicationBar.MenuItems>
      <shell:ApplicationBarIconButton x:Name="refreshButton"
                                      IconUri="/icons/appbar.refresh.rest.png"
                                      Text="refresh"
                                      Click="refreshButton_Click" />
      <shell:ApplicationBarIconButton x:Name="smallerFontIconButton"
                                      IconUri="/icons/appbar.minus.rest.png"
                                      Text="smaller font"
                                      Click="smallerFontIconButton_Click" />
      <shell:ApplicationBarIconButton x:Name="largerFontIconButton"
                                      IconUri="/icons/appbar.new.rest.png"
                                      Text="larger font"
                                      Click="largerFontIconButton_Click" />
      <shell:ApplicationBarIconButton x:Name="favFeedIconButton"
                                      IconUri="/icons/appbar.favs.addto.rest.png"
                                      Text="fav feed?"
                                      Click="favFeedIconButton_Click" />
    </shell:ApplicationBar>
  </phone:PhoneApplicationPage.ApplicationBar>
  <Grid x:Name="LayoutRoot"
        Background="{StaticResource backgroundBrush}">
    <Grid.RowDefinitions>
      <RowDefinition Height="34" />
      <RowDefinition />
      <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>
    <ctrls:AppHeader />
    <!--Pivot Control-->
    <c:Pivot x:Name="pivot"
             Grid.Row="1"
             ItemsSource="{Binding DisplayFeeds}"
             ItemTemplate="{StaticResource pageTemplate}"
             Foreground="{StaticResource foreBrush}">
      <c:Pivot.HeaderTemplate>
        <DataTemplate>
          <TextBlock Margin="0 -25"
                     Text="{Binding Title, Converter={StaticResource caseCvt}}"
                     FontSize="60" />
        </DataTemplate>
      </c:Pivot.HeaderTemplate>
    </c:Pivot>
  </Grid>

</phone:PhoneApplicationPage>